﻿#ifndef HOTELDETAILS_H
#define HOTELDETAILS_H

#include <QWidget>
#include "hoteldetailsheader.h"
#include "hoteldetailscontent.h"
#include "reservehotel.h"
#include "hoteldetailscomment.h"
#include "hoteldetailsinfo.h"
#include <QDebug>

namespace Ui {
class HotelDetails;
}

class HotelDetails : public QWidget
{
    Q_OBJECT
signals:
    void signalSubmitReserveHotel();
    void signalSubmitSaveHotel(bool);
public:
    explicit HotelDetails(QWidget *parent = nullptr);
    explicit HotelDetails(const HotelInfo &info,QWidget *parent = nullptr);
    ~HotelDetails();

    void setTime();
    void initWindowsUnits(const HotelInfo& info);
    void setTime(const QString& inTime, const QString& outTime);
    void cleanHotelDetails();
    void setHotelDetailsInfoShow();

public slots:
    void slotJumpToComment();

    void slotSetHouseList(bool result, QString msg);
    void slotHotelDetailsImage();
    void slotSaveHouseImage(const QString& type,const QImage &image);
    void slotSetHouseImage();

    void slotReserveHotel(const HouseInfo &houseInfo);
    void slotSubmitReserveResult(bool result, const QString &type);
    void slotSetCommentList(bool result, const QString &type);
    void slotSubmitSaveResult(bool result, const QString &msg);

    void slotSetCommentImage(bool result, const QString& msg, const QImage&image);

private:
    Ui::HotelDetails *ui;
    int m_contentCount;
    HotelInfo m_hotelInfo;
    QString m_inTime;
    QString m_outTime;

    HotelDetailsInfo *m_hotelDetailsInfo;
    ReserveHotel *m_reservehotel;
    HotelDetailsHeader *m_hoteldetailsheader;
    QVector<HotelDetailsContent *> m_hotelDetailsContentVector;
    HotelDetailsComment *m_hotelComment;

    QVector<QString> m_houseType;
    QVector<int> m_imageCount;
    QVector< QList<QImage> > m_imageList;
};

#endif // HOTELDETAILS_H
